/*
 * htprefetch.h
 *
 *  Created on: Nov 25, 2011
 *      Author: bendischinger
 */

#ifndef HTPREFETCH_H_
#define HTPREFETCH_H_

typedef struct {
	void (*helper_func)(block_matrix_t **args);
	block_matrix_t **mat;
} helper_start_arg_t;

enum op {
	ADD,
	MULTIPLY,
	TRANSPOSE,
	SEARCH,
	CREATE,
	PRINT,
	OP_NOT_FOUND
};

static char *op_str[] = {
	"add",
	"multiply",
	"transpose",
	"search",
	"create",
	"print"
};

enum mat_type {
	TYPE_RANDOM,
	TYPE_ORDERED,
	TYPE_IDENTITY,
	TYPE_NOT_FOUND
};

static char *mat_type_str[] = {
	"random",
	"ordered",
	"identity"
};

static char *usage_str = "Usage: htprefetch <operation> [options] -in file [options] [-in file [options]] [-out file [options]]\n"
" operations:\n"
"\t add - add two matrices, requires two -in files and one -out file\n"
"\t multiply - multiply two matrices, requires two -in files and one -out file\n"
"\t transpose - transpose a matrix, requires one -in file and one -out file\n"
"\t search <item> - search for an integer <item> in a marix, requires one -in file\n"
"\t\toutputs the block index and inter-block element index (blk_row, blk_col, elem_row, elem_col)\n"
"\t create <blk_dim> <elem_dim> <type> - requires one -out file\n"
"\t\tcreates a square block matrix with <blk_dim> x <blk_dim> blocks\n"
"\t\twith each block having <elem_dim> x <elem_dim> elements  (elem_dim^2 * blk_dim^2 total elements)\n"
"\t\t<type> can be random, ordered, or identity\n"
" operation options:\n"
"\t-p [low high] use prefetch helper thread with optional low high watermark (default low=50, high=100)\n"
"\t-v verbose (print matrix headers)\n"
"\t-vv really verbose (print full matrices)\n\n"
" file options :\n"
"\t-a use asynchronous IO (AIO)\n"
"\t-c [<size>] use block cache with size number of blocks (default 2048)\n"
"\t-d direct I/O (no OS page cache)\n";

#endif /* HTPREFETCH_H_ */
